﻿using Newtonsoft.Json.Linq;

namespace Chevron.OrderDetails.Models
{
    public class OrderDetailDto
    {
        public LabTestDto LabTest { get; set; }

        public bool IsCancelled { get; set; }

        public decimal Referral { get; set; }

        public void Deserialize(JObject obj, TestCatalog catalog)
        {
            LabTest = catalog[(string) obj[JsonFields.TestCode]];
            IsCancelled = (bool) obj[JsonFields.IsCancelled];
        }
    }
}